﻿using DataModels.Dto;
using DataModels.Dto.ServiceDayService;
using DataModels.Entities.ServiceDay;
using Microsoft.AspNetCore.Mvc;
using Services.ServiceDay;
using Utils;

namespace PropertyManagementWebApi.Controllers.ServiceDay
{
    public class ServiceDayController(ServiceDayService serviceDayService) :BaseController
    {
        private readonly ServiceDayService _serviceDayService = serviceDayService;

        /// <summary>
        /// 获取分数
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetPoints()
        {
            return await _serviceDayService.GetPoints();
        }

        /// <summary>
        /// 获取活动列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetServiceDayPointsActivities()
        {
            return await _serviceDayService.GetServiceDayPointsActivities();
        }

        /// <summary>
        /// 参与活动
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> JoinServiceDayPointsActivities([FromBody] JoinServiceDayPointsActivitiesInfo info)
        {
            return await _serviceDayService.JoinServiceDayPointsActivities(info.ServiceDayPointsActivitiesUUID);
        }

        /// <summary>
        /// 获取服务日的积分商品
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetServiceDayPointsProduct()
        {
            return await _serviceDayService.GetServiceDayPointsProduct();
        }

        /// <summary>
        /// 兑换积分商品
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> CashAPrizePointProduct([FromBody] CashAPrizePointProductInfo info)
        {
            return await _serviceDayService.CashAPrizePointProduct(info.ServiceDayPointsProductUUID);
        }

        /// <summary>
        /// 获取月服务日的商品
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<ResponseModel> GetProduct()
        {
            return await _serviceDayService.GetProduct();
        }

        /// <summary>
        /// 记录咨询信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResponseModel> ProductAsk(ServiceDayProductAskAbout info)
        {
            return await _serviceDayService.ProductAsk(info);
        }
    }
}
